jail: make udebug socket optional
authorFelix Fietkau <nbd@nbd.name>
Sat, 31 May 2025 14:20:29 +0000 (16:20 +0200)
committerFelix Fietkau <nbd@nbd.name>
Sat, 31 May 2025 14:20:31 +0000 (16:20 +0200)
Do not fail the jail mount if it does not exist, since udebugd is
optional.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
jail/fs.c
jail/jail.c

index 423878b3398f1424ec823a75882de99e874243d6..d0ca2b61327b2254fe5780df45c1b698fdf4c3bb 100644 (file)
--- a/jail/fs.c
+++ b/jail/fs.c
@@ -70,7 +70,8 @@ static int do_mount(const char *root, const char *orig_source, const char *targe
        assert(!(inner && !orig_source));
 
        if (source && is_bind && stat(source, &s)) {
-               ERROR("stat(%s) failed: %m\n", source);
+               if (error)
+                       ERROR("stat(%s) failed: %m\n", source);
                return error;
        }
 
index bd15b473276f522cdad57c2651ae05faa56e071b..2326ce7dd105bbca4083426359896601cb550a10 100644 (file)
@@ -2708,7 +2708,7 @@ int main(int argc, char **argv)
                        break;
                case 'D':
                        opts.namespace |= CLONE_NEWNS;
-                       add_mount_bind(udebug, 0, -1);
+                       add_mount_bind(udebug, 0, 0);
                        break;
                case 'l':
                        opts.namespace |= CLONE_NEWNS;